<script> 

function menu_list(){
	var dialog=art.dialog({
			id: 'msg',
			
		})
	$.ajax({
		   type: "POST",
		   url: "<?php echo base_url().'admin/admin/get_menu'?>",
		   
		   success: function(msg){
			 dialog.content(msg);
		   }
		});	
	
	
}

function add_menu(name,url,aid){
	var str='<dl id="a_'+aid+'"><a href="'+url+'">'+name+'</dl>'
	var dl=$('#a_'+aid).text();
	var op='';
	if(dl==''){
		$('#add_dl').append(str);
		op='add';
	}else{
		$('#a_'+aid).remove();
		op='remove';
	}
	
	$.ajax({
		   type: "POST",
		   url: "<?php echo base_url().'admin/admin/add_menu'?>",
		   data:'op='+op+'&id='+aid,
		   success: function(msg){
			 dialog.content(msg);
		   }
		});
	
	
}


</script>
<div class="nav_lf">
	<ul>
		
		<?php if(!empty($top_li)&&$top_li=='index'):?>
		<li>
		    <a href="javascript:;" class="box active">
		    	
		    	常用功能
		    </a>
		    <dl id="add_dl">
              <?php if (in_array('admin/gasstation/index', $_SESSION['ACL_ARR'])):?>
			       <dd><a href="<?php echo site_url();?>admin/gasstation/index">加油站管理</a></dd>
              <?php endif;?>  
                <?php if($_SESSION['LOGIN_NAME'] == 'caiwu'):?>
                    <dd>
                        <a  href="<?php echo site_url();?>admin/order/realtime_settle">提现订单</a>
                    </dd>
                <?php endif?>
              <?php if (in_array('admin/user/index', $_SESSION['ACL_ARR'])):?>
		          <dd><a href="<?php echo site_url();?>admin/user/index">用户列表</a></dd>
              <?php endif;?> 
              <?php if (in_array('admin/activity/coupon', $_SESSION['ACL_ARR'])):?>
              <dd><a href="<?php echo site_url();?>admin/activity/coupon">优惠券管理</a></dd>
              <?php endif;?> 
       			
              <?php foreach($menu as $v):?>
              <dd id="a_<?php echo $v['id']?>"><a href="<?php echo site_url().$v['acl_value'];?>"><?php echo $v['acl_name']?></a></dd>
              <?php endforeach;?>  
                
		    </dl>
           <!--   -->
            <dl style="text-align:center; border:none; margin-top:20px;" onclick="javascript:menu_list()">
        		<img src="<?php echo site_url();?>/themes/default/images/add_menu.png" width="50" height="50" />
        	</dl>
         
		</li>
        
        
		<?php elseif(!empty($top_li)&&$top_li=='trade'):?>
        <li>
		    <a href="javascript:;" class="box">
		    	<img src="<?php echo base_url()?>themes/default/images/order_icon.png" />
		    	订单管理
		    </a>
		    <dl>
              <?php if (in_array('admin/order/index', $_SESSION['ACL_ARR'])):?>
			  <dd><a <?php if($left_nav=='order'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/order/index">加油订单</a></dd>
              <?php endif;?> 
              <?php if (in_array('admin/order/fuel_list', $_SESSION['ACL_ARR'])):?>
		      <dd><a <?php if($left_nav=='fuel'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/order/fuel_list">油卡充值</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/activity/pin_order', $_SESSION['ACL_ARR'])):?>
		      <dd><a <?php if($left_nav=='pin'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/activity/pin_order">拼团订单</a></dd>
              <?php endif;?>
              
              <dd><a <?php if($left_nav=='baoyang_order'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/activity/baoyang_order">保养订单</a></dd>
            </dl>
         
		</li>
        
        <?php elseif(!empty($top_li)&&$top_li=='user_center'):?>
        <li>
		    <a href="javascript:;" class="box">
		    	<img src="<?php echo base_url()?>themes/default/images/user_icon.png" />
		    	用户中心
		    </a>
		    <dl>
              <?php if (in_array('admin/user/index', $_SESSION['ACL_ARR'])):?>
			  <dd><a <?php if($left_nav=='index'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/user/index">用户列表</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/user/car', $_SESSION['ACL_ARR'])):?>
              <dd><a <?php if($left_nav=='car'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/user/car">车贴记录</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/user/check', $_SESSION['ACL_ARR'])):?>
		      <dd><a <?php if($left_nav=='check'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/user/check">身份认证</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/user/car_type_check', $_SESSION['ACL_ARR'])):?>
              <dd><a <?php if($left_nav=='car_type_check'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/user/car_type_check">网约车认证</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/user/card', $_SESSION['ACL_ARR'])):?>
              <dd><a <?php if($left_nav=='card'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/user/card">银行卡认证</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/user/pay_check', $_SESSION['ACL_ARR'])):?>
              <dd><a <?php if($left_nav=='pay_check'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/user/pay_check">提现审核</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/user/pay', $_SESSION['ACL_ARR'])):?>
              <dd><a <?php if($left_nav=='pay'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/user/pay">提现打款</a></dd>
              <?php endif;?>
              <dd><a <?php if($left_nav=='invite_qrcode'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/user/invite_qrcode">邀请二维码</a></dd>
		    </dl>
         
		</li>
        <?php elseif(!empty($top_li)&&$top_li=='gasstation'):?>
        <?php if (in_array('admin/gasstation/index', $_SESSION['ACL_ARR'])):?>
        <li>
		    <a href="javascript:;" class="box">
		    	<img src="<?php echo base_url()?>themes/default/images/gasstation_icon.jpg" />
		    	油站中心
		    </a>
            
		    <dl>
			  <dd><a <?php if($left_nav=='gasstation'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/gasstation/index">油站管理</a></dd>
		    </dl>
            
         
		</li>
        <?php endif;?>

        <?php if (in_array('admin/gasstation/gasolinemodel', $_SESSION['ACL_ARR'])):?> 
        <li>
  		    <a href="<?php echo site_url();?>admin/gasstation/gasolinemodel" class="box <?php if($left_nav=='gasolinemodel'):?>active<?php endif;?>">
  		    	<img src="<?php echo base_url()?>themes/default/images/p_icon.png" style="width:25px; left:10px; top:10px;" />
  		    	发改委价格
  		    </a>  
		</li> 
        <?php endif;?> 

        <!-- 20190419 洗车店管理 -->
        <?php if (in_array('admin/gasstation/shops', $_SESSION['ACL_ARR'])):?>
        <li>
            <a href="<?php echo site_url();?>admin/gasstation/shops" class="box <?php if($left_nav=='shops'):?>active<?php endif;?>">
                <img src="<?php echo base_url()?>themes/default/images/p_icon.png" style="width:25px; left:10px; top:10px;" />
                洗车店管理
            </a>  
        </li>
        <?php endif;?>

        <!-- 20190419 洗车店管理 -->
        <?php if (in_array('admin/gasstation/shop_settle', $_SESSION['ACL_ARR'])):?>
        <li>
            <a href="<?php echo site_url();?>admin/gasstation/shop_settle" class="box <?php if($left_nav=='shop_settle'):?>active<?php endif;?>">
                <img src="<?php echo base_url()?>themes/default/images/p_icon.png" style="width:25px; left:10px; top:10px;" />
                提现审核
            </a>  
        </li>
        <?php endif;?>
        
        <?php elseif(!empty($top_li)&&$top_li=='third'):?>
        
			<?php if (in_array('admin/systems/third', $_SESSION['ACL_ARR'])):?>
                <li>
                    <a href="<?php echo site_url();?>admin/systems/third" class="box <?php if($left_nav=='third'):?>active<?php endif;?>">
                        <img src="<?php echo base_url()?>themes/default/images/liu_icon.png" />
                        第三方平台
                    </a>  
                </li>
            <?php endif;?>
            <?php if (in_array('admin/systems/partner', $_SESSION['ACL_ARR'])):?>
            <li>
                <a href="<?php echo site_url();?>admin/systems/partner" class="box <?php if($left_nav=='partner'):?>active<?php endif;?>">
                    <img src="<?php echo base_url()?>themes/default/images/par_icon.png" />
                    合伙人
                </a>
            </li>
        	<?php endif;?>
            <!-- 代理商 -->
            <?php if ($_SESSION['USER_ID'] == 2):?>
                <li>
                    <a href="<?php echo site_url();?>admin/systems/agent" class="box <?php if($left_nav=='agent'):?>active<?php endif;?>">
                        <img src="<?php echo base_url()?>themes/default/images/par_icon.png" />
                        代理商
                    </a>
                </li>
            <?php endif;?>
            <!-- 电商管家 -->
            <?php if ($_SESSION['USER_ID'] == 2):?>
            <li>
                <a href="<?php echo site_url();?>admin/systems/citic" class="box <?php if($left_nav=='citic'):?>active<?php endif;?>">
                    <img src="<?php echo base_url()?>themes/default/images/par_icon.png" />
                    电商管家
                </a>
            </li>
            <li>
                <a href="<?php echo site_url();?>admin/systems/citic_upload_file" class="box <?php if($left_nav=='citic_upload_file'):?>active<?php endif;?>">
                    <img src="<?php echo base_url()?>themes/default/images/par_icon.png" />
                    电商管家清分明细
                </a>
            </li>
            <?php endif;?>
        
        <?php elseif(!empty($top_li)&&$top_li=='activity'):?>
        	<?php if (in_array('admin/activity/coupon', $_SESSION['ACL_ARR'])):?>
            <li>
                <a href="<?php echo site_url();?>admin/activity/coupon" class="box <?php if($left_nav=='coupon'):?>active<?php endif;?>">
                    <img src="<?php echo base_url()?>themes/default/images/coupon_icon.png" />
                    优惠券管理
                </a>
            </li>
            <?php endif;?>
            <?php if (in_array('admin/activity/gasstation_activity', $_SESSION['ACL_ARR'])):?>
            <li>
                <a href="javascript:;" class="box">
                    <img src="<?php echo base_url()?>themes/default/images/pack_icon.png" />
                    活动管理
                </a>
                <dl>
                  <dd><a <?php if($left_nav=='gasstation_activity'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/activity/gasstation_activity">加油站活动</a></dd>
                </dl>
             
            </li>
       		<?php endif;?>

            <?php if (in_array('admin/activity/coupon', $_SESSION['ACL_ARR'])):?>
            <li>
                <a href="<?php echo site_url();?>admin/activity/save_oil" class="box <?php if($left_nav=='save_oil'):?>active<?php endif;?>">
                    <img src="<?php echo base_url()?>themes/default/images/coupon_icon.png" />
                    攒油活动
                </a>
            </li>
            <?php endif;?>
        <?php elseif(!empty($top_li)&&$top_li=='systems'):?>
        <li>
		    <a href="javascript:;" class="box">
		    	<img src="<?php echo base_url()?>themes/default/images/setting_icon.png" />
		    	系统设置
		    </a>  
            
            <dl>
              <?php if (in_array('admin/systems/user', $_SESSION['ACL_ARR'])):?>
			  <dd><a <?php if($left_nav=='user'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/systems/user">系统用户</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/systems/role', $_SESSION['ACL_ARR'])):?>
		      <dd><a <?php if($left_nav=='role'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/systems/role">系统角色</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/systems/app', $_SESSION['ACL_ARR'])):?>
              <dd><a <?php if($left_nav=='app'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/systems/app">app版本</a></dd>
              <?php endif;?>
              
              <dd><a <?php if($left_nav=='gasstation_app'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/systems/gasstation_app">油站app</a></dd>
              
			  <?php if (in_array('admin/systems/option', $_SESSION['ACL_ARR'])):?>
              <dd><a <?php if($left_nav=='option'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/systems/option">参数设置</a></dd>
              <?php endif;?>
              <?php if (in_array('admin/systems/sys_log', $_SESSION['ACL_ARR'])):?>
			  <dd><a <?php if($left_nav=='sys_log'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/systems/sys_log">系统日志</a></dd>
              <?php endif;?>
              <dd><a <?php if($left_nav=='city'):?>class="active"<?php endif;?> href="<?php echo site_url();?>admin/systems/city">城市管理</a></dd>
            </dl>
		</li>
        
        <?php endif;?>
		
	</ul>
</div>